<?php
namespace Home\Logic;

use Home\Model\PeizhilistModel;

/**
 * @copyright:Copyright (C) 2010-2014 LiZaoNet Inc. (http://www.lizaonet.com)
 * @license: http://www.lizaonet.com
 * @link:http://www.lizaonet.com
 * @since:File available since Release v1.0
 * @Created by Azrael
 * @User: Azrael
 * @Date: 2016/1/26
 * @Time: 16:40
 *
 */
class WebConfigLogic
{
    private $model = null;

    public function __construct()
    {
        $this->model = new PeizhilistModel();
    }

    /**
     * 获取网站信息
     * @param $fid 房间ID
     * @param $webtitle 配置名称
     * @return mixed
     */
    public function get_web_info($fid, $webtitle)
    {
        return $this->model->getInfoByFid($fid, $webtitle);
    }

    /**
     * 获取房间的配置信息
     * @param $fid
     * @return bool
     */
    public function getWebConfig($fid)
    {
        $list = $this->model->getConfig($fid);
        if (!$list) {
            return false;
        }
        foreach ($list as $k => $v) {
            $data[$v['pname']] = $v;
        }
        return $data;
    }

}